package com.ykfa.pf4j;

import java.util.List;

import ro.fortsoft.pf4j.JarPluginManager;
import ro.fortsoft.pf4j.PluginManager;

/**
 * @author yingkf
 * @date 2023年10月23日16:17:02
 */
public class Pf4jTest {
    public static void main(String[] args) {
        PluginManager pluginManager = new JarPluginManager();// or "new ZipPluginManager() / new DefaultPluginManager()"
        pluginManager.loadPlugins();
        pluginManager.startPlugins();
        List<Greeting> greetings = pluginManager.getExtensions(Greeting.class);
        greetings.forEach(Greeting::sayHello);
        pluginManager.stopPlugins();
    }
}
